﻿using System;
using System.IO;
using System.Collections.Generic;
using System.Text;

using System.Xml;
using System.Xml.Serialization;
using cz.uhul.DSMLv2;

namespace testDSML
{
  public class testResponse
  {

    public static void go()
    {
      LdResponseDocument r = new LdResponseDocument()
      {
        AuthResponse = new LdAuthResponse() 
        {
          ResultCode = new LdResultCode()
          {
            Code = LdResultCodeEnum.Success
            ,Description = ""
          }
        }
        ,AddResponses = new LdAddResponseCollection()
        {
          new LdAddResponse()
          {
            ResultCode = new LdResultCode()
            {
              Code = LdResultCodeEnum.Success
              ,Description = ""
            }
          }
          ,new LdAddResponse()
          {
            ResultCode = new LdResultCode()
            {
              Code = LdResultCodeEnum.Success
              ,Description = ""
            }
          }
        }
        , DeleteResponses = new LdDeleteResponseCollection()
        {

          new LdDeleteResponse()
          {
            ResultCode = new LdResultCode()
            {
              Code = LdResultCodeEnum.Success
              ,Description = ""
            }
          }
        }
        ,
        ModifyResponses = new LdModifyResponseCollection()
        {
          new LdModifyResponse()
          {
            ResultCode = new LdResultCode()
            {
              Code = LdResultCodeEnum.Success
              ,Description = ""
            }
          }
        }
        
      };

      
      StringBuilder sb = new StringBuilder();
      StringWriter sw = new StringWriter(sb);
      XmlSerializer xs = new XmlSerializer(typeof(LdResponseDocument));
      xs.Serialize(sw, r);
      Console.WriteLine(sb.ToString());

      XmlDocument doc = new XmlDocument();
      doc.LoadXml(sb.ToString());

      //LdResponseDocument tst = LdResponseDocument.Parse(doc);



    }





  }

}
